<template>
	<view>
		<StatusBar />
		<!-- <Grid :lists="lists" /> -->
	</view>
</template>

<script>
	import Grid from '@/components/Grid.vue'
	export default {
		components:{
			Grid
		},
		async onLoad(e) {
			let getList = {}
			if(e.leader_id)getList.leader_id = e.leader_id
			if(e.share_id)getList.share_id = e.share_id
			
			let token = uni.getStorageSync('token');
			if(token){
				let {user_info,code,msg} = await this.get('user/user_info', getList)
				if(e.leader_id){
					uni.setStorageSync('msg', msg)
					this.redirect('/pages/opera/index/success?msg='+msg);
				} else {
					if(code===1){
						let configs = uni.getStorageSync('configs');
						if(configs.is_review==1){
							this.redirect('/pages/opera/index/reviewhome')
						}else{
							let redirect_url = uni.getStorageSync('redirect_url')
							if(redirect_url){
								uni.setStorageSync('redirect_url',null)
								this.redirect(redirect_url)
							}else{
								this.redirect('/pages/opera/index/index')
							}
						}
					} else {
						uni.setStorageSync('token',null)
						this.error(msg||'登录状态已过期')
						this.redirect('/pages/index/index',1200)
					}
				}
			}else{
				this.error('请登录')
				this.redirect('/pages/index/index',1200)
			}
		},
		data() {
			return {
				lists:[{
					title:'商城',
					icon:'icon-shanghupiliangruzhu',
					url:'/pages/shop/index/home'
				},{
					title:'演示',
					icon:'icon-daimashili',
					url:'/pages/demo/index'
				},{
					title:'找师傅',
					icon:'icon-wode',
					url:'/pages/takeorder/index/home'
				},{
					title:'喝水',
					icon:'icon-wode',
					url:'/pages/water/index/home'
				}]
			}
		},
		methods: {
			
		}
	}
</script>

<style lang="less" scoped>
</style>
